﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Linq;
using System.Web;

namespace IQReportes.Models
{
    public class GlobalDbContext : DbContext
    {
        public GlobalDbContext() : base("conexionPrincipalIQ") { }
        public DbSet<Modulo> modulos { get; set; }
        public DbSet<Perfil> perfiles { get; set; }
        public DbSet<PerfilXModulo> perfilesXModulos { get; set; }
        public DbSet<Usuario> usuarios { get; set; }
        public DbSet<UsuarioXModulo> usuariosXModulos { get; set; }
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
            modelBuilder.Entity<Modulo>().ToTable("Modulo");
            modelBuilder.Entity<Perfil>().ToTable("Perfil");
            modelBuilder.Entity<PerfilXModulo>().ToTable("PerfilXModulo");
            modelBuilder.Entity<Usuario>().ToTable("Usuario");
            modelBuilder.Entity<UsuarioXModulo>().ToTable("UsuarioXModulo");
        }
    }
}